-- 
-- The server admin can lower gravity for a player
-- Needs admin_toys for the command that revert the effect
-- (See: https://github.com/wilkgr76/admin_toys)

if minetest.get_modpath("admin_toys") then

  minetest.register_chatcommand("lowgrav", {
     params = "<person>",
     description = "Gives that person low gravity",
     privs = {server=true},
     func = function(name, param)
       if param == nil then
         param = name
       end
       players = string.split(param,",");
       for i=1,#players do
         local currplayer = minetest.get_player_by_name(players[i]);
         currplayer:set_physics_override({gravity = 0.3})
         minetest.chat_send_player(name, "Gave low gravity to " .. players[i])
       end
   end,
  })
end
